<template>
	<view class="detail">
		<view class="d1">
			<view class="d2">
				<text>职位名称：{{detail.name}}</text>
				<text>岗位职责：{{detail.obligation}}</text>
				<text>公司地点：{{detail.address}}</text>
				<text>薪资待遇：{{detail.salary}}</text>
				<text>联系人：{{detail.contacts}}</text>
				<text>职位描述：{{detail.obligation}}</text>
				<text>职位需求：{{detail.need}}</text>
			</view>
		</view>
		<text style="font-size: 27px; color: red;">公司名称:</text>
		<view style="font-size: 19px; margin-top: 10px; margin-bottom: 10px;">
			{{name}}
		</view>
		<text style="font-size: 27px; color: red;">公司简介：</text>
		<view style="line-height: 30px; font-size: 19px;">
			<text>{{company.introductory}}</text>
		</view>
		<u-button type="primary" text="投简历" style="margin-top: 20px;"></u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				detail:{},
				id:0,
				name:'',
				company:{}
			}
		},
		onLoad(options) {
			this.id=options.id
			this.getdetail()
			this.name=options.name
			this.getcompany()
		},
		methods: {
			getdetail(){
				this.api.get('/prod-api/api/job/post/'+this.id).then(res=>{
					this.detail=res.data.data
				})
			},
			getcompany(){
				this.api.get('/prod-api/api/job/company/list?companyName='+this.name).then(res=>{
					console.log(res.data)
					this.company=res.data.rows[0]
				})
			}
		}
	}
</script>

<style lang="scss">
.d1{
	width: 300px;
	margin: 20px auto;
	border: 2px solid mediumpurple;
	border-radius: 15px;
	.d2{
		display: flex;
		flex-direction: column;
		line-height: 27px;
		margin-left: 10px;
	}
}
</style>
